﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;

namespace SWCad
{
    public class ClassMValueCoef
    {
        enum iProvince : int { iCustom = 0, iFJ = 1, iZJ = 2 }; //0 给定值; 1 福建; 2 浙江
        public string[] strProvince;
        public string[] strZone;
        public string[] strMFormular;
        public string[] strTheta;
        public string[] strJ;
        public string[] strComment;

         /// <summary>
        /// 读入m值参数设置字符串
        /// </summary>
        /// <param name="strValueRef"></param>
        /// <param name="iNum"></param>
        public void initCoef(string[] strValueRef,int iNum)
        {
            string buf;

            strProvince = new string[iNum];
            strZone = new string[iNum];
            strMFormular = new string[iNum];
            strTheta = new string[iNum];
            strJ = new string[iNum];
            strComment = new string[iNum];

            for (int i = 0; i < iNum; i++)
            {
                char[] ch = { '|' };

                buf = strValueRef[i].Trim();
                string[] stemp = buf.Split(ch);

                try { strProvince[i] = stemp[0]; }
                catch { MessageBox.Show("读取省份出错"); }

                try { strZone[i] = stemp[1]; }
                catch { MessageBox.Show("读取分区出错"); }

                try { strMFormular[i] = stemp[2]; }
                catch { MessageBox.Show("读取参数公式出错"); }

                try { strTheta[i] = stemp[3]; }
                catch { MessageBox.Show("读取θ定义出错"); }

                try { strJ[i] = stemp[4]; }
                catch { MessageBox.Show("读取J取值出错"); }

                try { strComment[i] = stemp[5]; }
                catch { MessageBox.Show("读取备注出错"); }
            }
        }
    }
}
